//
//  HNSH_GroupManageFooterView.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/18.
//

#import "HNSH_GroupManageFooterView.h"

@interface HNSH_GroupManageFooterView ()
/** */
@property (nonatomic, strong)UIButton * deleteBtn;
@end

@implementation HNSH_GroupManageFooterView

//MARK: Cycle Methods
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor appWhiteLabelColor];
        [self addAllViews];
        [self addAllLayout];
    }
    return self;
}

//MARK: Myself Methods
- (void)addAllViews{
    [self addSubview:self.deleteBtn];
}

- (void)addAllLayout{
    [self.deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(self);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(50);
    }];
}

- (void)deleteBtnAction{
    if (self.deleteBlock) {
        self.deleteBlock();
    }
}

//MARK: Getter Methods
- (UIButton *)deleteBtn{
    if (!_deleteBtn) {
        _deleteBtn = [UIButton new];
        _deleteBtn.titleLabel.font = [UIFont systemFontOfSize:15];
        [_deleteBtn setTitle:@"解散该群聊" forState:UIControlStateNormal];
        [_deleteBtn setTitleColor:[UIColor appGreenColor] forState:UIControlStateNormal];
        _deleteBtn.backgroundColor = [UIColor appWhiteLabelColor];
        [_deleteBtn addTarget:self action:@selector(deleteBtnAction) forControlEvents:UIControlEventTouchUpInside];
    }
    return _deleteBtn;
}
@end
